package com.mjk.common.core.jdbc.service.plus.idbservice;




import com.mjk.common.base.model.BaseEntity;
import com.mjk.common.core.jdbc.bean.BeePage;
import com.mjk.common.core.jdbc.service.plus.wrap.BeeComplexQueryWrapper;
import com.mjk.common.core.jdbc.service.plus.wrap.BeeQueryWrapper;

import java.util.List;
import java.util.Map;

/**	
 * 新版本单表查询接口 去除example
 */
public interface BeeDBService<T extends BaseEntity> {
    Integer countByWrapper(BeeQueryWrapper warpper);

    List<T> findManyByComplexWrapper(BeeComplexQueryWrapper warpper);

    BeePage<T> findManyByComplexWrapperWithPage(BeeComplexQueryWrapper warpper);

    List<T> findManyByWrapper(BeeQueryWrapper warpper);

    T findOneByWrapper(BeeQueryWrapper warpper);

    BeePage<T> findManyByWrapperWithPage(BeeQueryWrapper warpper);

    Integer save(T paramT);


    /**
     * 该方法主要为mysql返回主键值 带Id
     */
    Integer insert(T paramT);

    Integer update(T paramT);

    Integer update(BeeQueryWrapper warpper);

    Integer update(T entity, BeeQueryWrapper warpper);

    Integer save(List<T> paramList);

    Integer update(List<T> paramList);

    /**
     * 保存或者修改 对于存在的数据 修改 对于主键不存在的数据插入
     *
     * @param paramList
     * @return
     */
    public Integer saveOrUpdate(List<T> paramList);

    Integer delete(T paramT);

    Integer delete(BeeQueryWrapper warpper);

    Integer delete(List<T> paramList);

    List<Map<String,Object>> excuteSql(Map<String, Object> paramString);

    void excuteSql(String paramString);
}
